package com.eastfair.venuebooking.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.eastfair.annotation.annotation.dictionary.DictionaryField;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.venuebooking.demand.CustomerMainGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 客户 VO.
 *
 * @author dqq
 * @date 2022 /6/9
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
@Accessors(chain = true)
public class CustomerMainVO implements Serializable {

    private Map<String, Object> echoMap = new HashMap<>();

    @ApiModelProperty(value = "id")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long id;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Excel(name = "是否启用")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Excel(name = "是否删除")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 归属人员
     */
    @ApiModelProperty(value = "归属人员")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long belongTo;

    /**
     * 归属人员姓名
     */
    @ApiModelProperty(value = "归属人员姓名")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String belongToName;

    /**
     * 归属人员部门id
     */
    @ApiModelProperty(value = "归属人员部门id")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long orgCode;

    /**
     * 归属人员部门名称
     */
    @ApiModelProperty(value = "归属人员部门名称")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String orgName;

    /**
     * 客户中文名称
     */
    @ApiModelProperty(value = "客户中文名称")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerCnName;

    /**
     * 客户中文名称拼音
     */
    @ApiModelProperty(value = "客户中文名称拼音")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerNamePinyin;

    /**
     * 客户英文名称
     */
    @ApiModelProperty(value = "客户英文名称")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerEnName;

    /**
     * 客户简称
     */
    @ApiModelProperty(value = "客户简称")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerShortName;

    /**
     * 客户性质，同名数据字典
     */
    @DictionaryField(type = "CUSTOMER_PROPERTY")
    @ApiModelProperty(value = "客户性质")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerProperty;

    /**
     * 所属行业(同名数据字典)
     */
    @DictionaryField(type = "CUSTOMER_INDUSTRY")
    @ApiModelProperty(value = "所属行业")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerIndustry;

    /**
     * 客户状态(同名数据字典)
     */
    @DictionaryField(type = "CUSTOMER_STATUS")
    @ApiModelProperty(value = "客户状态")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerStatus;

    /**
     * 统一社会信用代码
     */
    @ApiModelProperty(value = "统一社会信用代码")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String uscc;

    /**
     * 客户星级，同名字典
     */
    @DictionaryField(type = "CUSTOMER_LEVEL")
    @ApiModelProperty(value = "客户星级")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerLevel;

    /**
     * 客户类型，同名数据字典
     */
    @DictionaryField(type = "CUSTOMER_TYPE")
    @ApiModelProperty(value = "客户类型")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerType;

    /**
     * 客户来源，同名数据字典
     */
    @DictionaryField(type = "CUSTOMER_SOURCE")
    @ApiModelProperty(value = "客户来源")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String customerSource;

    /**
     * 地区
     */
    @ApiModelProperty(value = "地区")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    private String region;

    /**
     * 详细地址
     */
    @ApiModelProperty(value = "详细地址")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    private String address;

    /**
     * 固定电话
     */
    @ApiModelProperty(value = "固定电话")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String phone;

    /**
     * 传真号码
     */
    @ApiModelProperty(value = "传真号码")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String faxNo;

    /**
     * 电子邮箱
     */
    @ApiModelProperty(value = "电子邮箱")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String email;

    /**
     * QQ号码
     */
    @ApiModelProperty(value = "QQ号码")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String qq;

    /**
     * 企业网址
     */
    @ApiModelProperty(value = "企业网址")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String website;

    /**
     * 企业规模，同名数据字典
     */
    @ApiModelProperty(value = "企业规模")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String companyScale;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String remark;

    /**
     * 公众号，图片地址
     */
    @ApiModelProperty(value = "公众号")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String wechatQrcodeUrl;

    /**
     * 最后跟进时间
     */
    @ApiModelProperty(value = "最后跟进时间")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private LocalDateTime lastFollowDate;

    /**
     * 前归属人
     */
    @ApiModelProperty(value = "前归属人")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long lastBelongTo;

    /**
     * 前归属人姓名
     */
    @ApiModelProperty(value = "前归属人姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String lastBelongToName;

    /**
     * 前归属部门ID
     */
    @ApiModelProperty(value = "前归属部门ID")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long lastOrgCode;

    /**
     * 前归属部门名称
     */
    @ApiModelProperty(value = "前归属部门名称")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String lastOrgName;

    /**
     * 下次跟进时间
     */
    @ApiModelProperty(value = "下次跟进时间")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private LocalDateTime nextFollowDate;

    /**
     * 客户状态(0正常 1公海 2垃圾 3静默客户)
     */
    @DictionaryField(type = "CUSTOMER_STATE")
    @ApiModelProperty(value = "客户状态")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer state;

    /**
     * cms系统同步状态 0:待同步;1:已同步
     */
    @ApiModelProperty(value = "cms系统同步状态 0:待同步;1:已同步")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer cmsSync;

    /**
     * 未跟进天数
     */
    @ApiModelProperty(value = "未跟进天数")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer notFollowDays;

    /**
     * 首要联系人id
     */
    @ApiModelProperty(value = "首要联系人id")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long contactId;

    /**
     * 首要联系人姓名
     */
    @ApiModelProperty(value = "首要联系人姓名")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String contactName;

    /**
     * 联系人手机号码
     */
    @ApiModelProperty(value = "联系人手机号码")
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String contactMobile;

    /**
     * 是否关注用户
     */
    @ApiModelProperty(value = "是否关注用户")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean isStartCustomer;

    /**
     * 更新时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    protected LocalDateTime updateTime;
    /**
     * 合同金额（包含场地保证金服务预付款）
     */
    @ApiModelProperty(value = "合同金额（包含场地保证金服务预付款）")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal contractAmount;
    /**
     * 合同回款金额
     */
    @ApiModelProperty(value = "合同回款金额")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal contractReturndAmount;
    /**
     * 已开票金额
     */
    @ApiModelProperty(value = "已开票金额")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal invoicedAmount;
    /**
     * 可开票金额
     */
    @ApiModelProperty(value = "可开票金额")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private BigDecimal sureInvoicedAmount;
    /**
     * 是否是新客户
     */
    @ApiModelProperty(value = "是否是新客户")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {CustomerMainGroup.QueryCustomerMain.class})
    private Boolean isNewCustomer;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long createdBy;
    /**
     * 创建人姓名
     */
    @ApiModelProperty(value = "创建人姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String createdByName;
    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private LocalDateTime createTime;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Long updatedBy;
    /**
     * 更新人姓名
     */
    @ApiModelProperty(value = "更新人姓名")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String updatedByName;
}
